#ifndef __PLUG_DISCOVERY_H__
#define __PLUG_DISCOVERY_H__

#include "hi_type.h"

#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif
#endif /* End of #ifdef __cplusplus */

#define PLUG_DISCOVERY_PORT 8899
#define PLUG_DISCOVERY_CB_MAXNUM 1


typedef enum PLUG_DISCOVERY_EVENT_e
{
    PLUG_DISCOVERY_EVENT_BUTT = -1,
    PLUG_DISCOVERY_EVENT_NEWBROADCAST,
}PLUG_DISCOVERY_EVENT_E;

typedef struct PLUG_DISCOVERY_EVENT_CFG_s
{
    HI_CHAR azIP[32];
}PLUG_DISCOVERY_EVENT_CFG_S;

typedef struct PLUG_DISCOVERY_EVENT_s
{
    PLUG_DISCOVERY_EVENT_E enType;
    PLUG_DISCOVERY_EVENT_CFG_S stCfg;
}PLUG_DISCOVERY_EVENT_S;

typedef HI_S32 (*PLUG_DISCOVERY_CB_EVENT)(PLUG_DISCOVERY_EVENT_S *pstEvent);


/**
 * @brief    discovery init
 * @param[in] none
 * @return 0 success,non-zero error code.
 * @exception    None
 */
HI_S32 PLUG_DISCOVERY_Init(HI_VOID);

/**
 * @brief    discovery deal (TODO)
 * @param[in] none
 * @return 0 success,non-zero error code.
 * @exception    None
 */
HI_S32 PLUG_DISCOVERY_TODO(HI_VOID);

/**
 * @brief    discovery deinit
 * @param[in] none
 * @return 0 success,non-zero error code.
 * @exception    None
 */
HI_S32 PLUG_DISCOVERY_Deinit(HI_VOID);

/**
*   @brief  register discovery event callback
*   @param[in] pfnFaceDetectCB : PLUG_DISCOVERY_CB_EVENT
*   @retval  0 success,others failed
*/
HI_S32 PLUG_DISCOVERY_Register(PLUG_DISCOVERY_CB_EVENT *pfnEventCB);


/**
*   @brief  unregister discovery event callback
*   @param[in] pfnFaceDetectCB : HI_FACEDETECT_CALLBACK
*   @retval  0 success,others failed
*/
HI_S32 PLUG_DISCOVERY_UnRegister(PLUG_DISCOVERY_CB_EVENT *pfnEventCB);


#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif /* End of #ifdef __cplusplus */

#endif /* __PLUG_DISCOVERY_H__ */

